/**
 * 
 */
package unseen.games.ui.manager;

import unseen.games.taptap.MainActivity;
import unseen.games.taptap.R;
import unseen.games.ui.GenericScreenManager;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * @author PERRAUDIN Steven <sperraudin@neotilus.com>
 *
 * @date 15 juin 2010
 */
public class MainMenuManager extends GenericScreenManager implements OnClickListener{

	private View mMainMenuView;
	
	private Button mNewGame, mSettings, mHighScore,  mBtnQuit;
	
	public MainMenuManager(Context context, View view) {
		super(context);
		initView(view);
	}

	private void initView(View view) {
		mMainMenuView = view;
		
		mNewGame 	= (Button) mMainMenuView.findViewById(R.id.new_game_button);
		mSettings 	= (Button) mMainMenuView.findViewById(R.id.settings_button);
		mHighScore 	= (Button) mMainMenuView.findViewById(R.id.hiscore_button);
		mBtnQuit = (Button) view.findViewById(R.id.quit_button);
				
		mNewGame.setOnClickListener(this);
		mSettings.setOnClickListener(this);
		mHighScore.setOnClickListener(this);
		mBtnQuit.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		int viewId = v.getId();
		switch(viewId)
		{
			case R.id.new_game_button:
				((MainActivity)mContext).showGameScreen();
				break;
			case R.id.settings_button:
				((MainActivity)mContext).showSettings();
				break;
			case R.id.hiscore_button:
				((MainActivity)mContext).showHighScores(0, false);
				break;
			case R.id.quit_button:
				((MainActivity)mContext).finish();
				break;
		}
	}

}
